<?php

namespace App\Http\Controllers\Home;

use App\Http\Controllers\Controller;
use App\Models\Category;
use Illuminate\Http\Request;

class CategoryController extends Controller
{
    public function index(Request $request)
    {
        $res = Category::whereNull('parent_id')
            ->where('status',1)
            ->get()->toArray();
        return apiResponse(data: $res);
    }
}
